#include "ProtocolFactory.h"
#include "Protocol_IP.h"
#include "Protocol_EP.h"
#include "Protocol_MAC.h"
#include "Protocol_TCP.h"
#include "Protocol_UDP.h"
#include "Protocol_SSL.h"
#include "Protocol_DNS.h"
#include "Protocol_FTP.h"
#include "Protocol_HTTP.h"

IProtocol * CProtocolFactory::CreateProtocol( const std::string& type )
{
	IProtocol* protocol = NULL;

	do 
	{
		if(type.compare("EP") == 0) 
		{
			protocol = new CProtocol_EP;
			break;
		}

		if(type.compare("MAC") == 0) 
		{
			protocol = new CProtocol_MAC;
			break;
		}

		if(type.compare("IP") == 0) 
		{
			protocol = new CProtocol_IP;
			break;
		}

		if(type.compare("TCP") == 0) 
		{
			protocol = new CProtocol_TCP;
			break;
		}

		if(type.compare("UDP") == 0) 
		{
			protocol = new CProtocol_UDP;
			break;
		}

		if(type.compare("SSL") == 0) 
		{
			protocol = new CProtocol_SSL;
			break;
		}

		if(type.compare("DNS") == 0) 
		{
			protocol = new CProtocol_DNS;
			break;
		}

		if(type.compare("FTP") == 0) 
		{
			protocol = new CProtocol_FTP;
			break;
		}

		if(type.compare("HTTP") == 0) 
		{
			protocol = new CProtocol_HTTP;
			break;
		}

	} while (0);
	
	return protocol;
}
